home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Periodicals / CSMP / C.S.M.P. Digest, Issue 3.002 next >
Internet Message Format  |  1994-06-09  |  88KB

  1. From: pottier@clipper.ens.fr (Francois Pottier)
  2. Subject: CSMP Digest, issue 2
  3. Date: Sat, 12 Mar 94 16:36:28 MET
  4.  
  5. C.S.M.P. Digest             Sat, 12 Mar 94       Volume 3 : Issue 2
  6.  
  7. Today's Topics:
  8.  
  9.         Any demo code using PowerPlant out there?
  10.         Converting Str255 to float
  11.         Creating-removing alias files
  12.         Help! Mac Dialog Box Questions
  13.         PackBits for resource compression?
  14.         Problems with serial routines on AV Macs?
  15.         Universal Headers vs. Old Headers
  16.         Using handles to purged-unloaded resources
  17.         Using the serial ports as an input for a SPDT switch.
  18.         WDEF Problems, driving me crazy...
  19.         ZcbFree Goes Negative (Error Number 33)
  20.         any good magazines?
  21.  
  22.  
  23.  
  24. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  25. (pottier@clipper.ens.fr).
  26.  
  27. The digest is a collection of article threads from the internet newsgroup
  28. comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
  29. regularly and want an archive of the discussions.  If you don't know what a
  30. newsgroup is, you probably don't have access to it.  Ask your systems
  31. administrator(s) for details.  If you don't have access to news, you may
  32. still be able to post messages to the group by using a mail server like
  33. anon.penet.fi (mail help@anon.penet.fi for more information).
  34.  
  35. Each issue of the digest contains one or more sets of articles (called
  36. threads), with each set corresponding to a 'discussion' of a particular
  37. subject.  The articles are not edited; all articles included in this digest
  38. are in their original posted form (as received by our news server at
  39. nef.ens.fr).  Article threads are not added to the digest until the last
  40. article added to the thread is at least two weeks old (this is to ensure that
  41. the thread is dead before adding it to the digest).  Article threads that
  42. consist of only one message are generally not included in the digest.
  43.  
  44. The digest is officially distributed by two means, by email and ftp.
  45.  
  46. If you want to receive the digest by mail, send email to listserv@ens.fr
  47. with no subject and one of the following commands as body:
  48.     help                        Sends you a summary of commands
  49.     subscribe csmp-digest Your Name    Adds you to the mailing list
  50.     signoff csmp-digest            Removes you from the list
  51. Once you have subscribed, you will automatically receive each new
  52. issue as it is created.
  53.  
  54. The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
  55. Questions related to the ftp site should be directed to
  56. scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
  57. digest are available there.
  58.  
  59. Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.
  60.  
  61.  
  62. -------------------------------------------------------
  63.  
  64. >From isdvw@wam.umd.edu (Michael R. Tuzi)
  65. Subject: Any demo code using PowerPlant out there?
  66. Date: 24 Feb 1994 19:53:51 GMT
  67. Organization: University of Maryland College Park
  68.  
  69. Can some kind soul out there help me with Powerplant??  I bought the 
  70. Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  71. useful, real C++ class library for handling Macintosh UI items.
  72.  
  73. Up until now, I have been unable to do a damn thing with it since
  74. it requires Resourcerer to create the PObj resources that everything
  75. is built on, and there appears to be NO way to build the class
  76. components any other way. (I know about the constructor, but it is 
  77. SEVERELY limited, in that it can only place the most rudimentary
  78. objects into a window (ie buttons, captions, etc)).
  79.  
  80. If anyone out there has any samples or pieces of code demonstrating
  81. how I can use this thing, I'd appreciate it if you could send me a copy
  82. via email (I'll post a summary if there is any interest.)  Otherwise
  83. I guess I'll have to wait another couple of years until a usable class
  84. library comes along (and don't flame me about Symantec C++ and the TCL;
  85. I have it and can't even get it to run on my 660 :-[).
  86.  
  87. ------------------------------------------------------------------------------
  88. isdvw@wam.umd.edu                  |                #include <innane_saying.h>
  89. ------------------------------------------------------------------------------
  90.  
  91. +++++++++++++++++++++++++++
  92.  
  93. >From keithb@corp.hp.com (Keith Bagley)
  94. Date: 24 Feb 1994 20:27:19 GMT
  95. Organization: Hewlett-Packard
  96.  
  97. In article <2kj0kf$f7n@cville-srv.wam.umd.edu> isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  98. >Can some kind soul out there help me with Powerplant??  I bought the 
  99. >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  100. >useful, real C++ class library for handling Macintosh UI items.
  101. >
  102. >Up until now, I have been unable to do a damn thing with it since
  103. >it requires Resourcerer to create the PObj resources that everything
  104. >is built on, and there appears to be NO way to build the class
  105. >components any other way. (I know about the constructor, but it is 
  106. >SEVERELY limited, in that it can only place the most rudimentary
  107. >objects into a window (ie buttons, captions, etc)).
  108. >
  109. >If anyone out there has any samples or pieces of code demonstrating
  110. >how I can use this thing, I'd appreciate it if you could send me a copy
  111. >via email (I'll post a summary if there is any interest.)  Otherwise
  112. >I guess I'll have to wait another couple of years until a usable class
  113. >library comes along....                     ^^^^^ 
  114.                          ????? Years ????
  115.  
  116. Uh...isn't CodeWarrior still Alpha/Beta? I just got my Development Release
  117. DR1 a couple of weeks ago. I bought it with the understanding that everything
  118. wasn't finished yet, and won't be finished until May sometime. I don't
  119. speak for Metrowerks (Shoot, I rarely speak for HP! :-)) but I think they're
  120. committed to having full functionality for what they've promised in the
  121. Final Release in May.
  122. I'm not trying to get into your head, but you sound like you feel cheated
  123. in some way; you KNEW the software was pre-release when you bought it.
  124. I doubt seriously that you'll have to wait YEARS for a usable class library.
  125. Even if PowerPlant doesn't suit your needs, there are other native-C++
  126. frameworks (StarView, Zinc, etc...) either here now or almost ready to
  127. ship.
  128.  
  129. Keith
  130.  
  131. +-------------------------------------------------------------------+
  132. |  |\    /|   .---.             |       Keith Bagley                |
  133. |  | \  / |  /        \     /   |       Hewlett-Packard Company     |
  134. |  |  \/  |  \..       \   /    |       Medical Systems Division    |
  135. |  |      |      \      \ /     |       175 Wyman Street            |
  136. |                /       |      |       Waltham, MA                 |
  137. |            ---'        |      |       keithb@hpwarjv.wal.hp.com   |
  138. +-------------------------------------------------------------------+
  139.  
  140.  
  141.  
  142.  
  143. +++++++++++++++++++++++++++
  144.  
  145. >From isdvw@wam.umd.edu (Michael R. Tuzi)
  146. Date: 24 Feb 1994 21:22:12 GMT
  147. Organization: University of Maryland College Park
  148.  
  149.  
  150. ( Tried to mail this to you, but our mailer bounced it back. )
  151.  
  152. Keith:
  153.  
  154. If I sounded like I was whining, that was not my intent.  I realized
  155. when I purchased CodeWarrior that it was a alpha/beta release and as
  156. such, some things would not be available.  I didn't expect that the
  157. framework would be completely unusable. (Alpha/Beta to me means that
  158. the basic functionality of the program is in place, but bugs need to
  159. be worked out and missing features need to be added).  If it was 
  160. necesssary for a developer to buy another piece of software to use
  161. this product, at least we could have been warned in advance (then I'd've
  162. waited rather than frustrate myself even further).
  163.  
  164. It appears to me from looking at the framework that it has a sound
  165. conceptual base, but without docs/examples/or the constructor, it
  166. cannot be used.  Maybe I'm being pessimistic, but I think it will be
  167. difficult for MW to get Powerplant ready for commercial release by the
  168. time they've stated.
  169.  
  170. As for the years of waiting for a usable class library, I've already
  171. waited several (from the time that TCL came out, until the announcement
  172. of Powerplant :-)).  
  173.  
  174. I sincerely hope that I'm wrong on this, because the sole reason that 
  175. I purchased CW was to get Powerplant. I'd be severely disappointed to
  176. have wasted another $200 on a development environment I can't use a la
  177. TCL.
  178.  
  179. +++++++++++++++++++++++++++
  180.  
  181. >From gdl@stlawrence.maths (Mr_G._Landweber_student_tel_2-73550)
  182. Date: 24 Feb 1994 23:20:13 GMT
  183. Organization: (none)
  184.  
  185.    In article <2kj0kf$f7n@cville-srv.wam.umd.edu> isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  186.    >Can some kind soul out there help me with Powerplant??  I bought the 
  187.    >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  188.    >useful, real C++ class library for handling Macintosh UI items.
  189.    >
  190.    >Up until now, I have been unable to do a damn thing with it since
  191.    >it requires Resourcerer to create the PObj resources that everything
  192.    >is built on, and there appears to be NO way to build the class
  193.    >components any other way. (I know about the constructor, but it is 
  194.    >SEVERELY limited, in that it can only place the most rudimentary
  195.    >objects into a window (ie buttons, captions, etc)).
  196.  
  197. I saw a demo of Code Warrior and PowerPlant yesterday, and the version
  198. I saw came with a type of "interface builder" whose main purpose was
  199. to construct and edit those "PObj" resources.  I watched the
  200. demonstrator create a dialog box with a number of buttons, text items,
  201. and other controls all in a matter of minutes without having to change
  202. any code.  This was a demo of Code Warrior gold, and it may have been
  203. a more recent release than what you were using.
  204.  
  205. -- Greg
  206.    gdl@maths.ox.ac.uk
  207.  
  208. +++++++++++++++++++++++++++
  209.  
  210. >From jwbaxter@olympus.net (John W. Baxter)
  211. Date: Fri, 25 Feb 1994 00:35:44 -0800
  212. Organization: Internet for the Olympic Peninsula
  213.  
  214. In article <2kj5q4$gqb@cville-srv.wam.umd.edu>, isdvw@wam.umd.edu (Michael
  215. R. Tuzi) wrote:
  216.  
  217. > ( Tried to mail this to you, but our mailer bounced it back. )
  218. > Keith:
  219. > If I sounded like I was whining, that was not my intent.  I realized
  220. > when I purchased CodeWarrior that it was a alpha/beta release and as
  221. > such, some things would not be available.  I didn't expect that the
  222. > framework would be completely unusable. (Alpha/Beta to me means that
  223. > the basic functionality of the program is in place, but bugs need to
  224. > be worked out and missing features need to be added).  If it was 
  225. > necesssary for a developer to buy another piece of software to use
  226. > this product, at least we could have been warned in advance (then I'd've
  227. > waited rather than frustrate myself even further).
  228.  
  229. It is true that "Constructor" isn't done yet.  It's not true that it is
  230. unusable (although the parts that aren't done clearly can't be used). 
  231. Resourceror is one solution.  So is writing Rez code, which can describe
  232. those resources quite well (and tediously).
  233.  
  234. And...DRn (particularly where n=1) doesn't imply Alpha or Beta...it implies
  235. Development.  Some parts of DR1 are alpha, some are development.
  236. -- 
  237. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  238.    jwbaxter@pt.olympus.net
  239.  
  240. +++++++++++++++++++++++++++
  241.  
  242. >From d88-jwa@mumrik.nada.kth.se (Jon W‰tte)
  243. Date: 25 Feb 1994 15:30:28 GMT
  244. Organization: Royal Institute of Technology, Stockholm, Sweden
  245.  
  246. >> If I sounded like I was whining, that was not my intent.  I realized
  247. >> when I purchased CodeWarrior that it was a alpha/beta release and as
  248. >> such, some things would not be available.  I didn't expect that the
  249. >> framework would be completely unusable. (Alpha/Beta to me means that
  250. >> the basic functionality of the program is in place, but bugs need to
  251.  
  252. No. The only thing labelled as Alpha is the C compiler; the
  253. framework and C++ compilers are labelled as development versions.
  254. The usual designation for d/a/b/fc is that:
  255. "d" shouldn't really get outside of development, or an initiated QC
  256.     department
  257. "a" is a version where what's in there is as debugged as the programmers
  258.     can make it, but still not feature complete
  259. "b" is where you are almost feature-complete, QC has had a whack at it,
  260.     and it's time for a more general public and diverse usage situations
  261.     to take over testing.
  262. "fc" is when you're trying to get it out the door, and want to have a
  263.    safety line on to guard against things slipping through the cracks.
  264.    Usually it works like "when fc has gone a week without complaints,
  265.    we ship it without further changes."
  266.  
  267. So, you got what you bought (some d and a releases) and I think it's
  268. been a terriffic value; porting from SC++ to CW was SO much faster
  269. thanks to the fast re-compile time; then going to the Apple SDK for
  270. actual code production was not so painful since CW took care of 99%
  271. of the conversion process.
  272.  
  273. -- 
  274.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  275.  Obsolete (n) - dependable, affordable, readily available
  276.  Support trailing-edge technology!
  277.                     -- Bruce H. McIntosh
  278.  
  279. +++++++++++++++++++++++++++
  280.  
  281. >From philip@world.std.com (Philip Borenstein)
  282. Date: Fri, 25 Feb 1994 18:41:28 GMT
  283. Organization: (none)
  284.  
  285. isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  286.  
  287. >Can some kind soul out there help me with Powerplant??  I bought the 
  288. >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  289. >useful, real C++ class library for handling Macintosh UI items.
  290.  
  291. >Up until now, I have been unable to do a damn thing with it since
  292. >it requires Resourcerer to create the PObj resources that everything
  293. >is built on, and there appears to be NO way to build the class
  294. >components any other way.
  295.  
  296. Unfortunately, the PObj format can't be descriped in Rez. DR2 will use a 
  297. slightly different format that's Rez-able. Even as we speak, Greg Dow is 
  298. writing constructors that let you build UI objects on the fly.
  299.  
  300. Hold on.
  301.  
  302. --philip.
  303.   philip@world.std.com
  304.  
  305.  
  306. +++++++++++++++++++++++++++
  307.  
  308. >From dougw@astro.as.arizona.edu (Doug Williams)
  309. Date: 25 Feb 1994 19:59:29 GMT
  310. Organization: University of Arizona, Tucson, AZ
  311.  
  312. isdvw@wam.umd.edu (Michael R. Tuzi) writes:
  313.  
  314. >Can some kind soul out there help me with Powerplant??  I bought the 
  315. >Metrowerks CodeWarrior Bronze CD BECAUSE it supposedly came with a 
  316. >useful, real C++ class library for handling Macintosh UI items.
  317.  
  318. >Up until now, I have been unable to do a damn thing with it since
  319. >it requires Resourcerer to create the PObj resources that everything
  320. >is built on, and there appears to be NO way to build the class
  321. >components any other way.
  322.  
  323.  
  324. A similar problem is keeping me from buying CodeWarrior as well: the huge
  325. amounts of PD code written in ThinkC. I have seen the BareBones converter
  326. program (ThinkC project -> CodeWarrior), but wonder how much of the _code_ out
  327. there is somehow ThinkC dependent.  Has anyone successfully compiled the
  328. WinterShell, TransSkel, or MacStarter projects under CodeWarrior?  If so, what
  329. changes (if any) had to be made to the code?  If the changes turn out to be
  330. minimal or (overly optimistically) nonexistant, I'll order CodeWarrior right
  331. after I get my CDRom drive.
  332.  
  333.     For example, the code fragment recently posted by Robert Mah about how
  334. to write mixed 68K C, PowerPC C and 68K assembly in both the Metrowerks and
  335. Symantec environments showed that the environments are very close, but not
  336. exactly the same.
  337.  
  338.  
  339. I'll try to summarize any info that comes my way, but I obviously won't be
  340. able to test any CodeWarrior code.
  341.  
  342. Doug Williams
  343. dougw@as.arizona.edu
  344.  
  345. no .sig
  346.  
  347. +++++++++++++++++++++++++++
  348.  
  349. >From E.J. Draper <draper@odin.mda.uth.tmc.edu>
  350. Date: 25 Feb 1994 22:59:25 GMT
  351. Organization: U.T.M.D. Anderson Cancer Center
  352.  
  353. In article <2kllb1$peh@auggie.CCIT.Arizona.EDU> Doug Williams,
  354. dougw@astro.as.arizona.edu writes:
  355. >    For example, the code fragment recently posted by Robert Mah about how
  356. >to write mixed 68K C, PowerPC C and 68K assembly in both the Metrowerks
  357. and
  358. >Symantec environments showed that the environments are very close, but
  359. not
  360. >exactly the same.
  361.  
  362. Why is that such a big deal?  THINK/Sym C and MPW C have always been
  363. different.
  364.  
  365. IMHO, if someone is unable/unwilling to modify a code snippet to suit the
  366. needs of their preferred compiler, they should think twice before using
  367. the snippet.
  368.  
  369.  
  370.       |E|J-  ED DRAPER
  371.  rEpar|D|<-  Radiologic/Pathologic Institute
  372.              The University of Texas M.D. Anderson Cancer Center
  373.              draper@utmdacc.mda.uth.tmc.edu
  374.  
  375. ---------------------------
  376.  
  377. >From ribtm@ttacs.ttu.edu (Greg Vaughn)
  378. Subject: Converting Str255 to float
  379. Date: Wed, 23 Feb 94 15:37:57 GMT
  380. Organization: Insulator Lab Texas Tech U. Physics
  381.  
  382. I'm looking for a way to convert and editable text item in a dialog box,
  383. which is read as a Str255 into a float (actually a double, but I can
  384. typecast that from a float) to use in calculations. Has anyone seen any
  385. code snippet that will do this in C? I'd appreciate any pointers anyone
  386. might have.
  387.  
  388.    ______
  389.   /\__  _\                  | Greg Vaughn
  390.   \/_/\ \/  exas            | Grad Student, Dept. of Physics
  391.      \ \_\  ech University  | Insulator Research Laboratory
  392.       \/_/  Lubbock, Texas  | E-Mail: ribtm@ttacs.ttu.edu
  393.  
  394. +++++++++++++++++++++++++++
  395.  
  396. >From scott.m.silver@dartmouth.edu (Scott M. Silver)
  397. Date: 23 Feb 1994 21:47:07 GMT
  398. Organization: Dartmouth College - Hanover, NH
  399.  
  400. In article <ribtm-230294093635@scm41-2.phys.ttu.edu>
  401. ribtm@ttacs.ttu.edu (Greg Vaughn) writes:
  402.  
  403. > I'm looking for a way to convert and editable text item in a dialog box,
  404. > which is read as a Str255 into a float (actually a double, but I can
  405. > typecast that from a float) to use in calculations. Has anyone seen any
  406. > code snippet that will do this in C? I'd appreciate any pointers anyone
  407. > might have.
  408.  
  409. The way I usually do this is do a P2CStr, and then atof (convert ascii
  410. to float), or atod (convet ascii to double). In english: Convert to a
  411. CStr, and then use ANSI library functions to convert it into the right
  412. kind of number.  
  413.  
  414. I remember a while back a threads flaming everyone about ineffieciency
  415. etc.  This is just one simple way of doing it.  
  416.  
  417. Scott
  418. ____________________________________________________________________
  419. Scott Silver            Dartmouth College                Hanover, NH
  420.  
  421. +++++++++++++++++++++++++++
  422.  
  423. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  424. Date: Wed, 23 Feb 1994 17:52:01 -0600
  425. Organization: University of Illinois at Urbana-Champaign
  426.  
  427. In article <ribtm-230294093635@scm41-2.phys.ttu.edu>, ribtm@ttacs.ttu.edu
  428. (Greg Vaughn) wrote:
  429.  
  430. >I'm looking for a way to convert and editable text item in a dialog box,
  431. >which is read as a Str255 into a float (actually a double, but I can
  432. >typecast that from a float) to use in calculations. Has anyone seen any
  433. >code snippet that will do this in C? I'd appreciate any pointers anyone
  434. >might have.
  435.  
  436. The best way to do it is use FormatStr2X, especially if you are taking the
  437. input from a dialog box. The nice thing about FormatStr2X is that it even
  438. works in funky foreign language scripts like Chinese. To use the routine,
  439. you must pass it not only the Str255 that you want converted, but also the
  440. results of the Str2Format routine and the GetItlTable routine. The
  441. documentation is generally poor, so I'll describe the parameters and give
  442. you a code example below. Here's what you pass to FormatStr2X:
  443.  
  444. source:       Obviously the string representation of the number.
  445.  
  446. myCanonical:  This is simply the format that you expect the number to be.
  447.               For example, if you wanted a positive integer with up to
  448.               3 decimal places, you would want the format to be "###".
  449.               The "#" symbol means a non-zero filled digit, whereas a
  450.               "0" would mean zero filled. If you wanted an floating point
  451.               exponential notation with up to 2 digit integer portion,
  452.               exactly 2 digit decimal portion, and exactly 1 digit after
  453.               the "E", your format would be "##.00E+0". In a format
  454.               string, you can put the format for a positive value, a
  455.               negative value, and 0 seperated by semicolons:
  456.                      ##.00E+0;-##.00E+0;0.00E+0
  457.  
  458.               But myCanonical is not the format string itself, but is an
  459.               internal format that you get from calling Str2Format. This
  460.               is so you can store the format returned to you by Str2Format
  461.               and use it on different international systems.
  462.  
  463. partsTable:   The number parts table from the 'itl4' resource. If you are
  464.               using System 7 or later, you can simply call IUGetItlTable,
  465.               asking it for the number parts table. You don't need to
  466.               worry about HLock'ing itlHandle because FormatStr2X doesn't
  467.               move memory; just don't do anything between your call to
  468.               IUGetItlTable and the FormatStr2X routine. If you are using
  469.               System 6, you need to perform the IUGetItlTable by hand.
  470.               It's a few lines of code; if need it, I can write up some
  471.               code. The extended number to put the thing into. Most C
  472.               compilers will convert it to a float on the fly.
  473.  
  474. So, let's say you expect the user to enter a string containing up to 5
  475. digits in the integer with a thousand marker between the 3rd and fourth
  476. digit, exactly two digits after the decimal, put it in parenthesis if it's
  477. negative, and have it just be "0.00" if it's 0. (I will use "." for the
  478. decimal and "," for the thousand marker.) Here's the C code (passing in
  479. the source string):
  480.  
  481. Handle itlHandle;             /* The 'itl4' resource handle */
  482. long offset, length;          /* Offset and length of parts table */
  483. NumFormatString myCanonical;  /* Canonical format */
  484. extended x;                   /* The number to put it into */
  485.  
  486. IUGetItlTable(iuCurrentScript, iuNumberPartsTable,
  487.               &itlHandle, &offset, &length);
  488. Str2Format("\p##,###.00;(##,###.00);0.00",
  489.            (NumberParts *)(*itlHandle + offset),
  490.            &myCanonical);
  491. FormatStr2X(source, &myCanonical,
  492.             (NumberParts *)(*itlHandle + offset), &x);
  493.  
  494. The FormatStr2X routines will return a result that will tell you if there
  495. are any parsing errors and to what level of confidence it thinks it parsed
  496. it correctly.
  497.  
  498. pr
  499. -- 
  500. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  501. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  502. System manager - Cognitive Science Group, Beckman Institute, UIUC
  503. Internet: resnick@cogsci.uiuc.edu
  504.  
  505. +++++++++++++++++++++++++++
  506.  
  507. >From resnick@cogsci.uiuc.edu (Pete Resnick)
  508. Date: Wed, 23 Feb 1994 17:31:21 -0600
  509. Organization: University of Illinois at Urbana-Champaign
  510.  
  511. In article <ribtm-230294093635@scm41-2.phys.ttu.edu>, ribtm@ttacs.ttu.edu
  512. (Greg Vaughn) wrote:
  513.  
  514. >I'm looking for a way to convert and editable text item in a dialog box,
  515. >which is read as a Str255 into a float (actually a double, but I can
  516. >typecast that from a float) to use in calculations. Has anyone seen any
  517. >code snippet that will do this in C? I'd appreciate any pointers anyone
  518. >might have.
  519.  
  520. The best way to do it is use FormatStr2X, especially if you are taking the
  521. input from a dialog box. The nice thing about FormatStr2X is that it even
  522. works in funky foreign language scripts like Chinese. To use the routine,
  523. you must pass it not only the Str255 that you want converted, but also the
  524. results of the Str2Format routine and the GetItlTable routine. The
  525. documentation is generally poor, so I'll describe the parameters and give
  526. you a code example below. Here's what you pass to FormatStr2X:
  527.  
  528. source:       Obviously the string representation of the number.
  529.  
  530. myCanonical:  This is simply the format that you expect the number to be.
  531.               For example, if you wanted a positive integer with up to
  532.               3 decimal places, you would want the format to be "###".
  533.               The "#" symbol means a non-zero filled digit, whereas a
  534.               "0" would mean zero filled. If you wanted an floating point
  535.               exponential notation with up to 2 digit integer portion,
  536.               exactly 2 digit decimal portion, and exactly 1 digit after
  537.               the "E", your format would be "##.00E+0". In a format
  538. string,
  539.               you can put the format for a positive value, a negative
  540. value,
  541.               and 0 seperated by semicolons: "##.00E+0;-##.00E+0;0.00E+0"
  542.  
  543.               But myCanonical is not the format string itself, but is an
  544.               internal format that you get from calling Str2Format. This
  545.               is so you can store the format returned to you by Str2Format
  546.               and use it on different international systems.
  547.  
  548. partsTable:   The number parts table from the 'itl4' resource. If you are
  549.               using System 7 or later, you can simply call IUGetItlTable,
  550.               asking it for the number parts table. You don't need to
  551.               worry about HLock'ing itlHandle because FormatStr2X doesn't
  552.               move memory; just don't do anything between your call to
  553.               IUGetItlTable and the FormatStr2X routine. If you are using
  554.               System 6, you need to perform the IUGetItlTable by hand.
  555. It's
  556.               a few lines of code; if need it, I can write up some code.
  557.  
  558. x:            The extended number to put the thing into. Most C compilers
  559.               will convert it to a float on the fly.
  560.  
  561. So, let's say you expect the user to enter a string containing up to 5
  562. digits in the integer with a thousand marker between the 3rd and fourth
  563. digit, exactly two digits after the decimal, put it in parenthesis if it's
  564. negative, and have it just be "0.00" if it's 0. (I will use "." for the
  565. decimal and "," for the thousand marker.) Here's the C code (passing in
  566. the source string):
  567.  
  568. Handle itlHandle;             /* The 'itl4' resource handle */
  569. long offset, length;          /* Offset and length of number parts table
  570. */
  571. NumFormatString myCanonical;  /* Canonical format */
  572. extended x;                   /* The number to put it into */
  573.  
  574. IUGetItlTable(iuCurrentScript, iuNumberPartsTable,
  575.               &itlHandle, &offset, &length);
  576. Str2Format("\p##,###.00;(##,###.00);0.00",
  577.            (NumberParts *)(*itlHandle + offset),
  578.            &myCanonical);
  579. FormatStr2X(source, &myCanonical, (NumberParts *)(*itlHandle + offset),
  580. &x);
  581.  
  582. The FormatStr2X routines will return a result that will tell you if there
  583. are any parsing errors and to what level of confidence it thinks it parsed
  584. it correctly.
  585.  
  586. pr
  587. -- 
  588. Pete Resnick        (...so what is a mojo, and why would one be rising?)
  589. Graduate assistant - Philosophy Department, Gregory Hall, UIUC
  590. System manager - Cognitive Science Group, Beckman Institute, UIUC
  591. Internet: resnick@cogsci.uiuc.edu
  592.  
  593. +++++++++++++++++++++++++++
  594.  
  595. >From u9119523@sys.uea.ac.uk (Graham Cox)
  596. Date: Thu, 24 Feb 1994 15:34:41 GMT
  597. Organization: School of Information Systems, UEA, Norwich
  598.  
  599. In article <resnick-230294173121@colt-42.slip.uiuc.edu>,
  600. resnick@cogsci.uiuc.edu (Pete Resnick) wrote:
  601.  
  602. > In article <ribtm-230294093635@scm41-2.phys.ttu.edu>, ribtm@ttacs.ttu.edu
  603. > (Greg Vaughn) wrote:
  604. > >I'm looking for a way to convert and editable text item in a dialog box,
  605. > >which is read as a Str255 into a float (actually a double, but I can
  606.  
  607. Why not just use SANE's Str2Num procedure?
  608.  
  609. --------------------------------------------------------------------------
  610. Love & BSWK, Graham
  611.  
  612. -Everyone is entitled to their opinion, no matter how wrong they may be...
  613. --------------------------------------------------------------------------
  614.  
  615. ---------------------------
  616.  
  617. >From DAVISM@kcgl1.eng.ohio-state.edu (Mike Davis, Chief of Operations -- KCGL)
  618. Subject: Creating-removing alias files
  619. Date: 24 Feb 1994 23:33:41 GMT
  620. Organization: The Ohio State University
  621.  
  622.  
  623.     I would very much like to create and remove an alias file on the
  624. desktop via a program.  The basic idea is to provide a hint to the current
  625. Mac user that (s)he needs to disconnect from a service by displaying an alias
  626. to the program which allows him/her to (dis)connect with his/her name instead
  627. of "program-name alias".  When the user does disconnect, the alias file is
  628. removed from the desktop.  I've looked through a number of (N)IM volumes, but
  629. all I can find reference to are alias _records_ and manipulating same.
  630. Apparently, creating alias _files_ isn't recommended, but I'd like to do it
  631. anyway (;-), unless someone can offer a better method of constantly notifying
  632. the user that (s)he needs to disconnect before leaving the Mac.
  633.  
  634.                             Thanks,
  635.                              Mike
  636. --
  637.  Internet: davism@KCGL1.eng.ohio-state.edu |
  638.             -or- DAVISM+@osu.edu           |   These Thoughts, They Be Mine
  639.    BITNET: DAVISM+@OHSTMAIL.BITNET         |
  640.  
  641. +++++++++++++++++++++++++++
  642.  
  643. >From jpmah@undergrad.math.uwaterloo.ca (John Mah)
  644. Date: Fri, 25 Feb 1994 02:51:02 GMT
  645. Organization: University of Waterloo
  646.  
  647. Basically, you want to create a resource file of type 'alis' & creator 'fndr', 
  648. stuff a AliasHandle (generated by a call to NewAlias()) into a resource of
  649. type 'alis' with resource ID of 0. Make sure to set the 'alias' bundle bit of 
  650. the created file.
  651.  
  652. Here's a sample code snippet taken from one of my programs (adjust to suit
  653. to your tastes):
  654.  
  655. ---- begin snippet ----
  656.  
  657.     AliasHandle    hArticle;
  658.     OSErr        err;
  659.     FInfo        fndrInfo;
  660.     FSSpec        articleSpec;
  661.     short        refNum;
  662.     FSSpec        newsFolderFS;
  663.  
  664.         // Create minimal alias for the original article.
  665.  
  666.     newsFolderFS.vRefNum = gSpoolFolder->fldrVRefNum;
  667.     newsFolderFS.parID = gSpoolFolder->fldrDirID;
  668.     newsFolderFS.name[0] = '\0';
  669.  
  670.     err = NewAlias( &newsFolderFS, theSpec, &hArticle );
  671.     if ( !hArticle || err != noErr ) {
  672.         LogError( "Could not allocate alias for article!" );
  673.         return;
  674.     }
  675.  
  676.         // Setup the article file, initialize it and specify where it is
  677.         // supposed to be put. If it exists, then delete it.
  678.  
  679.     FSMakeFSSpec( gSpoolFolder->fldrVRefNum, entry->dirID, 
  680.         (StringPtr) articleNumber, &articleSpec );
  681.     FSpCreateResFile( &articleSpec, 'fndr', 'alis', 0 );
  682.     err = ResError();
  683.     if ( err == dupFNErr ) {
  684.         err = FSpDelete( &articleSpec );
  685.         FSpCreateResFile( &articleSpec, 'fndr', 'alis', 0 );
  686.         err = ResError();
  687.     }
  688.     if ( err != noErr ) {
  689.         LogError( "Couldn't create alias file!" );
  690.         return;
  691.     }
  692.     
  693.         // Create the resource file and open it for writing.
  694.  
  695.     refNum = FSpOpenResFile( &articleSpec, fsWrPerm );    
  696.     if ( refNum == -1 || ResError() != noErr ) {
  697.         LogError( "Couldn't open an alias file!" );
  698.         return;
  699.     }
  700.     
  701.         // Write alias resource to file.
  702.  
  703.     AddResource( (Handle) hArticle, 'alis', 0, "\p" );
  704.     ChangedResource( (Handle) hArticle );
  705.     if ( ResError() == noErr ) {
  706.         WriteResource( (Handle) hArticle );
  707.         HPurge( (Handle) hArticle );
  708.     }
  709.  
  710.     CloseResFile( refNum );
  711.     
  712.         // Now set the "alias" finder bit.
  713.     
  714.     FSpGetFInfo( &articleSpec, &fndrInfo );
  715.     fndrInfo.fdFlags |= (1L << 15);
  716.     FSpSetFInfo( &articleSpec, &fndrInfo );
  717.  
  718. ---- end snippet ----
  719.  
  720. Hope that gives you an idea of how things work.
  721.  
  722. - John
  723.  
  724.  
  725. ---------------------------
  726.  
  727. >From chriss@microware.com (Chris Severtson)
  728. Subject: Help! Mac Dialog Box Questions
  729. Date: Tue, 22 Feb 1994 16:58:10 GMT
  730. Organization: Microware Systems Corp., Des Moines, Iowa
  731.  
  732. I am not sure if this is the correct group to post to, but here goes...
  733.  
  734. Dialog Box Questions:
  735. -------------------
  736. 1) The toolbox call HiliteControl() can be used to dim a control and its
  737. title. I am desperately in search of a way to "dim" statText and editText
  738. dialog items.
  739.  
  740. 2) I am also searching for the answer to this question: I use the call
  741. SetDialogDefaultItem() and HiliteControl() to mark my "OK" button as the
  742. default button and set it to be initially "dim". ModalDialog() hilites this
  743. button even though I "dimmed" it before calling it. After the first time
  744. through the loop though, it will stay dimmed if I dim it again. I think it
  745. has to do with the fact that it is the first call and ModalDialog() has to
  746. draw the window. What I am looking for is a workaround.
  747.  
  748. Any help you can offer is greatly appreciated.  Please email me your
  749. responses.
  750.  
  751. +++++++++++++++++++++++++++
  752.  
  753. >From walkerj@math.scarolina.edu (Jim Walker)
  754. Date: 22 Feb 1994 19:11:31 GMT
  755. Organization: University of South Carolina - Columbia - Computer Science
  756.  
  757. chriss@microware.com (Chris Severtson) writes:
  758.  
  759. >1) The toolbox call HiliteControl() can be used to dim a control and its
  760. >title. I am desperately in search of a way to "dim" statText and editText
  761. >dialog items.
  762.  
  763. I posted some text item dimming source code (THINK C) at the ftp site
  764. bigbird.csd.scarolina.edu, pub/mac.
  765. --
  766.  
  767.  -- Jim Walker  USC Dept. of Math.  walkerj@math.scarolina.edu
  768.  
  769. +++++++++++++++++++++++++++
  770.  
  771. >From rmah@panix.com (Robert S. Mah)
  772. Date: Tue, 22 Feb 1994 16:00:59 -0500
  773. Organization: One Step Beyond
  774.  
  775. chriss@microware.com (Chris Severtson) wrote:
  776.  
  777. > 1) The toolbox call HiliteControl() can be used to dim a control and its
  778. > title. I am desperately in search of a way to "dim" statText and editText
  779. > dialog items.
  780.  
  781. Just draw a 50% gray pattern over the text in srcBic mode.  If you wanna
  782. get fancy and use Color QD, use the blend mode.  Note that, you'll have to
  783. apply these in your filter proc because a screen depth change or an update
  784. on the dialog will cause the item text to redraw itself in 100% black.
  785.  
  786. For finer control, draw the static text using a userItem proc.  If you do
  787. this, and are running only on System 7, you can use the new grayishTextOr
  788. (or something like that) drawing mode to draw diabled text items.
  789.  
  790. Finally, "dimming" editable text items is no harder than static text items.
  791.  However, the primary problem is with making dialog manager skip these
  792. items during the tabbing sequence.
  793.  
  794. I believe there is a code snippet (available on the reference library CD's
  795. and on ftp.apple.com in /dts/mac/sc/snippets/toolbox/, called "Dialog Bits"
  796. by C.K. Haun that illustrates how to do both these things.
  797.  
  798.  
  799. > 2) I am also searching for the answer to this question: I use the call
  800. > SetDialogDefaultItem() and HiliteControl() to mark my "OK" button as the
  801. > default button and set it to be initially "dim". ModalDialog() hilites this
  802. > button even though I "dimmed" it before calling it. After the first time
  803. > through the loop though, it will stay dimmed if I dim it again. I think it
  804. > has to do with the fact that it is the first call and ModalDialog() has to
  805. > draw the window. What I am looking for is a workaround.
  806.  
  807. One way that might work is to open and draw the dialog box offscreen first.
  808.  Then dim the control.  Then move it to the correct location and then start
  809. your ModalDialog loop.  I haven't tried this myself, so take this advice
  810. with a grain of salt.
  811.  
  812. Cheers,
  813. Rob
  814. ________________________________________________________________________
  815.  Robert S. Mah              One Step Beyond              rmah@panix.com
  816.  
  817. +++++++++++++++++++++++++++
  818.  
  819. >From u9119523@sys.uea.ac.uk (Graham Cox)
  820. Date: Fri, 25 Feb 1994 12:44:19 GMT
  821. Organization: School of Information Systems, UEA, Norwich
  822.  
  823. In article <rmah-220294160059@rmah.dialup.access.net>, rmah@panix.com
  824. (Robert S. Mah) wrote:
  825.  
  826. > chriss@microware.com (Chris Severtson) wrote:
  827. > Finally, "dimming" editable text items is no harder than static text items.
  828. >  However, the primary problem is with making dialog manager skip these
  829. > items during the tabbing sequence.
  830.  
  831. You can 'cast' a stat text item to an edit text one and vice versa- the
  832. handle to the item is the same. The dialog manager then automatically skips
  833. the item. However, you have to check before changing the type that it's not
  834. the currently selected item- if it is (by comparing the ID to the value in
  835. the dialog record) then change the selection to another field first. Its
  836. much easier to do than describe- one of my dialogs in MacTriv (archive
  837. sites) illustrates this behaviour. 
  838.  
  839.  
  840.  
  841. --------------------------------------------------------------------------
  842. Love & BSWK, Graham
  843.  
  844. -Everyone is entitled to their opinion, no matter how wrong they may be...
  845. --------------------------------------------------------------------------
  846.  
  847. ---------------------------
  848.  
  849. >From AIKEN <INRA000@MUSICB.MCGILL.CA>
  850. Subject: PackBits for resource compression?
  851. Date: Fri, 25 Feb 1994 02:46:07 GMT
  852. Organization: McGill University
  853.  
  854.     Is PackBits suitable for use as a general-purpose compression
  855. algorithm for data which is known to be highly redundant? THINK
  856. Reference speaks of its use for compressing B&W bitmap images, since
  857. they tend to contain large solid areas, but is there any reason it
  858. couldn't be used for other purposes? How fast is it?
  859.  
  860.     Mark Aiken
  861.     inra@musicb.mcgill.ca
  862.  
  863.  
  864. +++++++++++++++++++++++++++
  865.  
  866. >From mhall@cs.oberlin.edu
  867. Date: 25 Feb 1994 20:23:08 GMT
  868. Organization: Oberlin College
  869.  
  870. In article  <24FEB94.23510214.0070@VM1.MCGILL.CA> AIKEN 
  871. <INRA000@MUSICB.MCGILL.CA> writes: 
  872.  
  873. >     Is PackBits suitable for use as a general-purpose compression
  874. > algorithm for data which is known to be highly redundant? THINK
  875. > Reference speaks of its use for compressing B&W bitmap images, since
  876. > they tend to contain large solid areas, but is there any reason it
  877. > couldn't be used for other purposes? How fast is it?
  878. >     Mark Aiken
  879. >     inra@musicb.mcgill.ca
  880.  
  881. Packbits is also suitable for 8-bit color (PICT's automatically use packbits 
  882. when bitmap information is stored), and I think that there also simple 
  883. compression schemes for 16 and 32 bit color as well.
  884.  
  885. Packbits uses run length encoding to compress data.  That is, if there are 3 or 
  886. more identical BYTES in a row, it will encode into 2 bytes, where the first 
  887. byte is the count (of identical bytes) and the second is the byte itself. (it's 
  888. a little more complex than this, but this is the general idea.  But be aware 
  889. that there is more overhead than just this).  If there are less than three 
  890. identical consecutive bytes, no compression takes place.
  891.  
  892. So, whether or not PackBits is good for your purpose, it  is if you have 
  893. massive repetition of 1,2,4, or 8 bit patterns - and the repetition is 
  894. consecutive.  For text, packbits is pretty useless.  But, it is a general 
  895. routine - it is also lossless (data is preserved exactly) so if you have data 
  896. that fits the above criteria, use it.
  897.  
  898. -matt
  899.  
  900.  
  901. ---------------------------
  902.  
  903. >From ingemar@lysator.liu.se (Ingemar Ragnemalm)
  904. Subject: Problems with serial routines on AV Macs?
  905. Date: Fri, 25 Feb 1994 10:52:59 GMT
  906. Organization: (none)
  907.  
  908.  
  909. I'm posting this for a friend. He has some working serial routines, just
  910. the ordinary stuff. When he used that, in a MacroMedia Director plug-in,
  911. on an AV Mac, it crashed, and so did MacroMedias demo sources. (Their
  912. *compiled* module did work, though, so we guess that is a newer version.)
  913.  
  914. Is there something we need to know when using the serial ports on AV Macs?
  915.  
  916.  
  917. --
  918. ---
  919. Ingemar Ragnemalm, PhD
  920. Image processing, Mac shareware games
  921. E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  922.  
  923. +++++++++++++++++++++++++++
  924.  
  925. >From isis@netcom.com (Mike Cohen)
  926. Date: Fri, 25 Feb 1994 18:49:28 GMT
  927. Organization: ISIS International
  928.  
  929. ingemar@lysator.liu.se (Ingemar Ragnemalm) writes:
  930.  
  931.  
  932. >I'm posting this for a friend. He has some working serial routines, just
  933. >the ordinary stuff. When he used that, in a MacroMedia Director plug-in,
  934. >on an AV Mac, it crashed, and so did MacroMedias demo sources. (Their
  935. >*compiled* module did work, though, so we guess that is a newer version.)
  936.  
  937. >Is there something we need to know when using the serial ports on AV Macs?
  938.  
  939. Someone reported that to me. I have some code that opens the serial driver &
  940. it fails on an AV mac. One work around seems to be to use the CTB and the
  941. Serial Tool instead (although you'll proably start getting calls "why doesn't
  942. it work - it says tool not found"). Unfortunately, I don't have access to an
  943. AV for testing right now - my client's building was destroyed last month.
  944.  
  945. >--
  946. >---
  947. >Ingemar Ragnemalm, PhD
  948. >Image processing, Mac shareware games
  949. >E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  950. -- 
  951. Mike Cohen - isis@netcom.com
  952. NewtonMail: MikeC49506 / ALink: D6734 / AOL: MikeC20
  953.  
  954.  
  955. +++++++++++++++++++++++++++
  956.  
  957. >From bgoldstein@jplsp2.jpl.nasa.gov (Bruce Goldstein)
  958. Date: Fri, 25 Feb 1994 10:47:57 -0700
  959. Organization: Jet Propulsion Laboratory
  960.  
  961. In article <CLs0wC.FrG@lysator.liu.se>, ingemar@lysator.liu.se (Ingemar
  962. Ragnemalm) wrote:
  963.  
  964. > I'm posting this for a friend. He has some working serial routines, just
  965. > the ordinary stuff. When he used that, in a MacroMedia Director plug-in,
  966. > on an AV Mac, it crashed, and so did MacroMedias demo sources. (Their
  967. > *compiled* module did work, though, so we guess that is a newer version.)
  968. > Is there something we need to know when using the serial ports on AV Macs?
  969. > --
  970. > ---
  971. > Ingemar Ragnemalm, PhD
  972. > Image processing, Mac shareware games
  973. > E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se
  974. You should get the AV Serial Extension (unsupported Apple software).
  975. It is available somewhere on sumex-aim.stanford.edu
  976.  
  977. ---------------------------
  978.  
  979. >From Willie Rauchwerger <willie-rauchwerger@uokhsc.edu>
  980. Subject: Universal Headers vs. Old Headers
  981. Date: 22 Feb 1994 15:38:44 GMT
  982. Organization: OU Health Sciences Center
  983.  
  984. Well, I was in the process of porting my program from
  985. Think C 6.0 to Metrowerks C++ 68k, and I ran into a little
  986. inconsistency with the Universal Header files and the old
  987. Think includes, and when I checked, the old MPW includes.
  988.  
  989. (Note how the the first argument is defined.)
  990.  
  991. In the Think headers, "ToolUtils.h":
  992. pascal void GetIndPattern(Pattern thePat,
  993.                           short patternListID, short index); 
  994.  
  995. In the old MPW headers, "ToolUtils.h":
  996. pascal void GetIndPattern(Pattern thePat,
  997.                           short patternListID, short index); 
  998.  
  999. But in the Metrowerks headers (Apple Universal Headers), "ToolUtil.h":
  1000. extern pascal void GetIndPattern(Pattern *thePat,
  1001.                           short patternListID, short index);
  1002.  
  1003. And the Mac on RISC SDK headers (Apple Universal Headers) "ToolUtil.h":
  1004. extern pascal void GetIndPattern(Pattern *thePat,
  1005.                           short patternListID, short index);
  1006.  
  1007. All of this brings up several questions:
  1008.  
  1009. 1. Is this inconsistency a plain mistake?
  1010. 2. If not, is it because of the PPC C compilers ignoring
  1011.     the pascal keyword calling conventions?
  1012. 3. If so (#2), how do I maintain the same set of source for
  1013.     Think and for Metrowerks?
  1014.     (I can't completely commit to MW, the debugger is too flaky.)
  1015.     
  1016. Help, anyone...thanks.
  1017.  
  1018.  
  1019. Willie Rauchwerger          AppleLink: Willie
  1020. Telemedicine Software Guy   Internet: willie-rauchwerger@uokhsc.edu
  1021. OU Health Sciences Center
  1022.  
  1023. +++++++++++++++++++++++++++
  1024.  
  1025. >From d88-jwa@mumrik.nada.kth.se (Jon W‰tte)
  1026. Date: 23 Feb 1994 07:58:53 GMT
  1027. Organization: Royal Institute of Technology, Stockholm, Sweden
  1028.  
  1029. In <2kd8u4$tv@romulus.ucs.uoknor.edu> Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  1030.  
  1031. >In the old MPW headers, "ToolUtils.h":
  1032. >pascal void GetIndPattern(Pattern thePat,
  1033.  
  1034. >But in the Metrowerks headers (Apple Universal Headers), "ToolUtil.h":
  1035. >extern pascal void GetIndPattern(Pattern *thePat,
  1036.  
  1037. >1. Is this inconsistency a plain mistake?
  1038.  
  1039. No. "Pattern" changed from unsigned char[8] to a struct two years ago,
  1040. but Symantec hasn't kept up with that change yet.
  1041. This is a well-documented gotcha when going to the universal headers.
  1042. You will have to fins ALL your pattern references and probably change
  1043. them, including "gray" which is now written "& qd . gray"
  1044.  
  1045. >2. If not, is it because of the PPC C compilers ignoring
  1046. >    the pascal keyword calling conventions?
  1047.  
  1048. Partly that, and partly because the char-array had some unfortunate
  1049. problems.
  1050.  
  1051. >3. If so (#2), how do I maintain the same set of source for
  1052. >    Think and for Metrowerks?
  1053.  
  1054. You make the universal headers work under Think. Good luck!
  1055. -- 
  1056.  -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
  1057.   "And now, from the makers of EDLIN, comes: Windows NT!"
  1058.  
  1059. +++++++++++++++++++++++++++
  1060.  
  1061. >From jbrowne@zaphod.ncsa.uiuc.edu (Jim Browne)
  1062. Date: 24 Feb 94 00:23:02 GMT
  1063. Organization: University of Illinois at Urbana
  1064.  
  1065. d88-jwa@mumrik.nada.kth.se (Jon W‰tte) writes:
  1066.  
  1067. >In <2kd8u4$tv@romulus.ucs.uoknor.edu> Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  1068.  
  1069. >>3. If so (#2), how do I maintain the same set of source for
  1070. >>    Think and for Metrowerks?
  1071.  
  1072. >You make the universal headers work under Think. Good luck!
  1073.  
  1074. Do this in your prefix file:
  1075.  
  1076. #ifdef THINK_C
  1077. #define PATTERN(x) x
  1078. #else
  1079. #define PATTERN(X) &x
  1080. #endif
  1081.  
  1082. And then surround your pattern references with PATTERN(   )
  1083.  
  1084.  
  1085. -- 
  1086. Jim Browne                                             | jbrowne@ncsa.uiuc.edu |
  1087. Head NCSA Mac Telnet Hacker, SDG System Administrator  | (217) 244-7798        |
  1088. <a href="http://www.ncsa.uiuc.edu/SDG/People/jbrowne/jbrowne.html">Click me</a>
  1089.  "People can buy HANDGUNS easier." - S. Anichini, on accquiring IMSA yearbooks.
  1090.  
  1091. +++++++++++++++++++++++++++
  1092.  
  1093. >From ramapo@crestone.ssd.kodak.com (Pete Hoch x39699)
  1094. Date: Wed, 23 Feb 1994 15:53:48 GMT
  1095. Organization: Eastman Kodak Company
  1096.  
  1097. Willie Rauchwerger (willie-rauchwerger@uokhsc.edu) wrote:
  1098. : (Note how the the first argument is defined.)
  1099. : In the old MPW headers, "ToolUtils.h":
  1100. : pascal void GetIndPattern(Pattern thePat,
  1101. :                           short patternListID, short index); 
  1102. : But the Mac on RISC SDK headers (Apple Universal Headers) "ToolUtil.h":
  1103. : extern pascal void GetIndPattern(Pattern *thePat,
  1104. :                           short patternListID, short index);
  1105. : All of this brings up several questions:
  1106. : 1. Is this inconsistency a plain mistake?
  1107.  
  1108. This is not a mistake but it does look funny.
  1109.  
  1110. : 2. If not, is it because of the PPC C compilers ignoring
  1111. :     the pascal keyword calling conventions?
  1112. : 3. If so (#2), how do I maintain the same set of source for
  1113. :     Think and for Metrowerks?
  1114.  
  1115. Good guess but wrong.  The original development environment for the
  1116. Macintosh (which ran on the Lisa for you history bufs.)  passed any
  1117. argument which was longer than four bytes by reference.  This is
  1118. why you never see Rect in a toolbox argument call but you allways
  1119. see Rect*.  Since the Pattern structure (which used to be an array)
  1120. is longer than four bytes so it must be passed by reference.  When
  1121. Pattern was declaired as an array this happend for you because of
  1122. the design on the C language.
  1123.  
  1124. Pete
  1125.  
  1126.  
  1127. +++++++++++++++++++++++++++
  1128.  
  1129. >From zobkiw@datawatch.com (joe zobkiw)
  1130. Date: Thu, 24 Feb 1994 18:06:54 GMT
  1131. Organization: Datawatch Corporation
  1132.  
  1133. Getting the new headers to work under THINK is not a big deal. There are
  1134. some exceptions but you can get around them if you need to relatively
  1135. easily. I've uploaded a project to AOL that will help you to use the new
  1136. Universal Headers with THINK C. That is, if you still want to use THINK C
  1137. at all.
  1138.  
  1139. +++++++++++++++++++++++++++
  1140.  
  1141. >From jwbaxter@olympus.net (John W. Baxter)
  1142. Date: Thu, 24 Feb 1994 10:13:57 -0800
  1143. Organization: Internet for the Olympic Peninsula
  1144.  
  1145. In article <CLopHq.JqA@newsserver.pixel.kodak.com>,
  1146. ramapo@crestone.ssd.kodak.com (Pete Hoch x39699) wrote:
  1147.  
  1148. The urgency of the change to Pattern was simple:  the old way led to some
  1149. crashing situations on 68000 Macs, and Pattern should never have been
  1150. defined that way in C.  Too close a copy of the Pascal definition was made
  1151. early on.
  1152.  
  1153. -- 
  1154. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1155.    jwbaxter@pt.olympus.net
  1156.  
  1157. +++++++++++++++++++++++++++
  1158.  
  1159. >From jwbaxter@olympus.net (John W. Baxter)
  1160. Date: Thu, 24 Feb 1994 10:09:57 -0800
  1161. Organization: Internet for the Olympic Peninsula
  1162.  
  1163. In article <2kf2bt$e2b@news.kth.se>, d88-jwa@mumrik.nada.kth.se (Jon Wtte)
  1164. wrote:
  1165.  
  1166. > >3. If so (#2), how do I maintain the same set of source for
  1167. > >    Think and for Metrowerks?
  1168. > You make the universal headers work under Think. Good luck!
  1169. > -- 
  1170.  
  1171. Which implies that the task is harder than it really is.  Pretty good
  1172. instructions on doing the job are included (strangely...the only place I've
  1173. seen them) on the AppleScript 1.1 Developer Kit CD.  [Since AS 1.1 has
  1174. Universalized headers).]
  1175.  
  1176. It was working for me, although I needed to revert to standard (ie, old
  1177. fashioned) Think headers to check something out.  I have a nice StuffIt
  1178. archive with the modern ones.  I don't care much, since I've almost
  1179. entirely switched to CodeWarrior.
  1180.  
  1181. -- 
  1182. John Baxter    Port Ludlow, WA, USA  [West shore, Puget Sound]
  1183.    jwbaxter@pt.olympus.net
  1184.  
  1185. +++++++++++++++++++++++++++
  1186.  
  1187. >From giles@med.cornell.edu (Aaron Giles)
  1188. Date: Thu, 24 Feb 1994 13:55:30 -0500
  1189. Organization: Cornell University Medical College
  1190.  
  1191. In article <cshotton-240294113210@oac2.hsc.uth.tmc.edu>,
  1192. cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton) wrote:
  1193.  
  1194. > > >3. If so (#2), how do I maintain the same set of source for
  1195. > > >    Think and for Metrowerks?
  1196. > > 
  1197. > > You make the universal headers work under Think. Good luck!
  1198. > That, or use a few conditional compiles. I have 3 different programs which
  1199. > all compile under Think C, Metrowerks C (68k & PPC), and MPW PPC C and the
  1200. > total number of #ifdefs to support this amounts to about 3 for each entire
  1201. > program. Most of the hassles are with Universal ProcPtrs.
  1202.  
  1203. Making the Universal Headers work under THINK is not so hard.  Just turn on
  1204. 4-bit ints, 8-byte doubles, and put a "#define applec 1" in the THINK C
  1205. options pre-compile area.  With the possible exception of numerics, that
  1206. makes 99% of it work.
  1207.  
  1208. -- 
  1209. Aaron Giles
  1210. Macintosh & Newton Developer
  1211. Cornell University Medical College
  1212. giles@med.cornell.edu
  1213.  
  1214. +++++++++++++++++++++++++++
  1215.  
  1216. >From cshotton@oac.hsc.uth.tmc.edu (Chuck Shotton)
  1217. Date: Thu, 24 Feb 1994 11:32:10 -0600
  1218. Organization: Academic Computing, UT-Houston
  1219.  
  1220. In article <2kf2bt$e2b@news.kth.se>, d88-jwa@mumrik.nada.kth.se (Jon Wtte)
  1221. wrote:
  1222.  
  1223. > >3. If so (#2), how do I maintain the same set of source for
  1224. > >    Think and for Metrowerks?
  1225. > You make the universal headers work under Think. Good luck!
  1226.  
  1227. That, or use a few conditional compiles. I have 3 different programs which
  1228. all compile under Think C, Metrowerks C (68k & PPC), and MPW PPC C and the
  1229. total number of #ifdefs to support this amounts to about 3 for each entire
  1230. program. Most of the hassles are with Universal ProcPtrs.
  1231.  
  1232. --_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_\_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  1233. Chuck Shotton                             \ 
  1234. Assistant Director, Academic Computing     \   "Are we there yet?"
  1235. U. of Texas Health Science Center Houston   \ 
  1236. cshotton@oac.hsc.uth.tmc.edu  (713) 794-5650 \ 
  1237. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\-_-_-_-_-_-_-_-_-_-_-_-_-
  1238.  
  1239. +++++++++++++++++++++++++++
  1240.  
  1241. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1242. Date: 25 Feb 94 11:12:16 +1300
  1243. Organization: University of Waikato, Hamilton, New Zealand
  1244.  
  1245. In article <2kd8u4$tv@romulus.ucs.uoknor.edu>, Willie Rauchwerger <willie-rauchwerger@uokhsc.edu> writes:
  1246. > Well, I was in the process of porting my program from
  1247. > Think C 6.0 to Metrowerks C++ 68k, and I ran into a little
  1248. > inconsistency with the Universal Header files and the old
  1249. > Think includes, and when I checked, the old MPW includes.
  1250. >
  1251. > (Note how the the first argument is defined.)
  1252. >
  1253. > In the Think headers, "ToolUtils.h":
  1254. > pascal void GetIndPattern(Pattern thePat,
  1255. >                           short patternListID, short index);
  1256. >
  1257. > In the old MPW headers, "ToolUtils.h":
  1258. > pascal void GetIndPattern(Pattern thePat,
  1259. >                           short patternListID, short index);
  1260. >
  1261. > But in the Metrowerks headers (Apple Universal Headers), "ToolUtil.h":
  1262. > extern pascal void GetIndPattern(Pattern *thePat,
  1263. >                           short patternListID, short index);
  1264. >
  1265. > And the Mac on RISC SDK headers (Apple Universal Headers) "ToolUtil.h":
  1266. > extern pascal void GetIndPattern(Pattern *thePat,
  1267. >                           short patternListID, short index);
  1268. >
  1269. > 1. Is this inconsistency a plain mistake?
  1270.  
  1271. It looks like a mistake in the first two versions that was corrected in the
  1272. last two. In Pascal calling conventions, anything larger than four bytes is
  1273. passed by reference, so I guess the incorrect version would actually work
  1274. (I've seen the same mistake elsewhere in the interfaces).
  1275.  
  1276. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1277. Info & Tech Services Division              fax: +64-7-838-4066
  1278. University of Waikato            electric mail: ldo@waikato.ac.nz
  1279. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1280.  
  1281. ---------------------------
  1282.  
  1283. >From griscom@media.mit.edu (Dan Griscom)
  1284. Subject: Using handles to purged-unloaded resources
  1285. Date: Wed, 23 Feb 1994 03:46:25 GMT
  1286. Organization: MIT Media Laboratory
  1287.  
  1288.  
  1289. I want to delete a humongous resource from a resource file, but I
  1290. don't want to load it into memory first. I'd like to be able to do
  1291. this:
  1292.  
  1293. ...
  1294. SetResLoad(false);
  1295. theRes = Get1NamedResource(theResType, theResName);
  1296. SetResLoad(true);
  1297. RemoveResource(theRes);
  1298. ...
  1299.  
  1300. Would this be kosher? Is there a better way?
  1301.  
  1302. This can be restated as a more general question: can handles to
  1303. resources fetched when ResLoad is false (or handles to purged
  1304. resources) be used in routines where the resource contents aren't
  1305. needed, such as GetResSize, GetResInfo, SetResInfo, etc?
  1306.  
  1307. Thanks,
  1308. Dan Griscom
  1309. Suitable Systems
  1310.  
  1311. +++++++++++++++++++++++++++
  1312.  
  1313. >From ivanski@world.std.com (Ivan M CaveroBelaunde)
  1314. Date: Wed, 23 Feb 1994 14:27:21 GMT
  1315. Organization: The World Public Access UNIX, Brookline, MA
  1316.  
  1317. griscom@media.mit.edu (Dan Griscom) writes:
  1318. >I want to delete a humongous resource from a resource file, but I
  1319. >don't want to load it into memory first. I'd like to be able to do
  1320. >this:
  1321. >...
  1322. >SetResLoad(false);
  1323. >theRes = Get1NamedResource(theResType, theResName);
  1324. >SetResLoad(true);
  1325. >RemoveResource(theRes);
  1326. >...
  1327. >Would this be kosher? Is there a better way?
  1328.  
  1329. This works for me. Just to be sure, however, I'd double check that
  1330. the resID is what you expect - since resNames do not have to be
  1331. unique, it is possible you end up getting a different resource
  1332. >From the one you wanted...
  1333.  
  1334. >This can be restated as a more general question: can handles to
  1335. >resources fetched when ResLoad is false (or handles to purged
  1336. >resources) be used in routines where the resource contents aren't
  1337. >needed, such as GetResSize, GetResInfo, SetResInfo, etc?
  1338.  
  1339. I cannot attest to every permutation of this, but the ones I've used
  1340. (Get/SetResInfo) worked fine.
  1341.  
  1342. -Ivan
  1343. ---
  1344. Ivan Cavero Belaunde (ivanski@world.std.com)
  1345. Avid VideoShop Project Lead
  1346. Avid Technology, Inc.
  1347.  
  1348. +++++++++++++++++++++++++++
  1349.  
  1350. >From peter@ncrpda.curtin.edu.au (Peter N Lewis)
  1351. Date: 24 Feb 1994 10:53:44 +0800
  1352. Organization: NCRPDA, Curtin University
  1353.  
  1354. ivanski@world.std.com (Ivan M CaveroBelaunde) writes:
  1355.  
  1356. >This works for me. Just to be sure, however, I'd double check that
  1357. >the resID is what you expect - since resNames do not have to be
  1358. >unique, it is possible you end up getting a different resource
  1359. >from the one you wanted...
  1360.  
  1361. WHy?  Resource IDs are not unique either, and you don't check them against
  1362. the name.  Basically, use the appropriate accessor depending on what you
  1363. resource you want.
  1364.    Peter.
  1365. -- 
  1366. _______________________________________________________________________
  1367. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  1368.  
  1369. ---------------------------
  1370.  
  1371. >From greenber@reed.edu (Andrew Greenberg)
  1372. Subject: Using the serial ports as an input for a SPDT switch.
  1373. Date: 21 Feb 1994 23:14:03 GMT
  1374. Organization: Reed College,  Portland, Oregon
  1375.  
  1376. Hello!
  1377.  
  1378. I am attempting to read a simple SPDT microswitch via the serial ports
  1379. on Mac SEs and later models.
  1380.  
  1381. I'm using CTS (HSKo) as an input, and I need a differential signal (both
  1382. + and - ) to drive the input. The only way I can see to do this is hold
  1383. TxD low or high and use the two corresponding differential outputs (TxD+
  1384. and TxD-) as the differential signal I need.
  1385.  
  1386. I can't find any helpful references as to how to do this; the closest
  1387. I've seen is page 360 of the Mac Hardware reference (2nd ed) where it
  1388. talks about asserting /RTS. However, I can't find any info on how to do this.
  1389.  
  1390. If you have any information on asserting TxD or /RTS, I'd really appreciate
  1391. a quick note, or even a referral!
  1392. (I'm using Think c 6, BTW).
  1393.  
  1394. Thanks!!
  1395.  
  1396. Andrew Greenberg
  1397. (greenber@reed.edu)
  1398.  
  1399.  
  1400. +++++++++++++++++++++++++++
  1401.  
  1402. >From   <a@b.c.d>
  1403. Date: Tue, 22 Feb 1994 15:49:50 GMT
  1404. Organization:  
  1405.  
  1406. In article <2kbf7r$52o@scratchy.reed.edu> Andrew Greenberg,
  1407. greenber@reed.edu writes:
  1408.  
  1409. >I am attempting to read a simple SPDT microswitch via the serial ports
  1410. >on Mac SEs and later models...
  1411.  
  1412. We did something like this a while ago, using the serial port on a IIfx to
  1413. connect to a photocopy card reader/decrementer; a very simple machine, 
  1414. with one input (there is a card with value on it) and one output
  1415. (decrement
  1416. the card value by one unit).  (This is on a kiosk system in a gallery;
  1417. used to
  1418. charge for printouts.)
  1419.  
  1420. According to my notes (which aren't guaranteed to be accurate) we used a
  1421. three wire cable to connect the unit to the Mac, which was connected to
  1422. CTS (pin 2?), TxD (3) and GND (4).   The card reader shorted CTS to GND
  1423. when the it had a valid card; TxD was either asserted to decrement the
  1424. card.  I don't have any information about how CTS was tied high when
  1425. not being grounded.
  1426.  
  1427. To read the switch, we use:
  1428.    
  1429.   #define CAN_PRINT    -1
  1430.         if ( iErr = SerStatus( iPortRef, &PortStatus ) )
  1431.             ... error stuff
  1432.         return( PortStatus.ctsHold == CAN_PRINT );
  1433.  
  1434. To decrement the card value, we use
  1435.             if ( iErr = SerSetBrk( iPortRef ) )        ... error stuff
  1436.             Delay( 10L, &l );
  1437.             if ( iErr = SerClrBrk( iPortRef ) )        ... error stuff
  1438.  
  1439. My guess from reading your note is that if you wire your switch to flip
  1440. CTS between GND and TxD (presumably with a resistor), and combine the
  1441. two calls above to set break, read the switch, and then clear break, you
  1442. might have a working solution.
  1443.  
  1444. Caveat: I know nothing about hardware, and have destroyed logic boards in
  1445. my time; seek qualified medical advice, and I'm not responsible for any
  1446. damage you do....
  1447.  
  1448. Having said that, the above solution allowed us to make this interface
  1449. with
  1450. no additional hardware and has been working fine under heavy use on nine
  1451. workstations for the last 30 months.
  1452.  
  1453. Hope this helps,
  1454. Ben
  1455.  
  1456. +++++++++++++++++++++++++++
  1457.  
  1458. >From sokoloff@mv.mv.com (Jim Sokoloff)
  1459. Date: Fri, 25 Feb 1994 14:33:53 GMT
  1460. Organization: MV Communications, Inc.
  1461.  
  1462. I would recommend using the GPIa pin.  Docs for its use are in a Tech note
  1463. (something like 283 springs to mind)  Sorry, I worked on this long ago, 
  1464. before the tech notes got renamed.
  1465.  
  1466. If you can't find it, E-mail me and I'll look up the tech note for you.
  1467. If you don't have TNs, e-mail and I'll copy the source from the note and
  1468. forward it.
  1469.  
  1470. ---Jim Sokoloff
  1471.  
  1472.  
  1473. ---------------------------
  1474.  
  1475. >From warwick_j@cubldr.colorado.edu
  1476. Subject: WDEF Problems, driving me crazy...
  1477. Date: Wed, 23 Feb 1994 09:08:31 GMT
  1478. Organization: University of Colorado, Boulder
  1479.  
  1480. I have been writing a WDEF for a floating palette and have been running
  1481. into very strange erratic behaviour. Inside Macintosh : Toolbox Essentials
  1482. doesn't help any with its rather brief and incomplete description of how
  1483. to write a WDEF. What I need to know is:
  1484.  
  1485. 1) How to calculate the strucRgn and contRgn regions. IM:TE says to do
  1486.    this 'based on the current graphics port' but somehow I think that's
  1487.    wrong.
  1488.  
  1489. 2) How to retrieve standard window colors from the default color table
  1490.    easily. I want my palette to reflect the settings in the Color control
  1491.    panel.
  1492.  
  1493. 3) Which QD commands can be used when drawing a window's contents? I have
  1494.    had little success with RGBForeColor() - I usually get totally different
  1495.    colors to what I requested.
  1496.  
  1497. Any ideas? I would really appreciate any ideas or sample code you might
  1498. have.
  1499.  
  1500. Nick.
  1501.  
  1502. +++++++++++++++++++++++++++
  1503.  
  1504. >From t-gaul@i-link.com (Troy Gaul)
  1505. Date: Wed, 23 Feb 1994 11:47:39 -0600
  1506. Organization: I-Link, Ltd.
  1507.  
  1508. In article <1994Feb23.020831.1@cubldr.colorado.edu>,
  1509. warwick_j@cubldr.colorado.edu wrote:
  1510.  
  1511. > I have been writing a WDEF for a floating palette and have been running
  1512. > into very strange erratic behaviour. Inside Macintosh : Toolbox Essentials
  1513. > doesn't help any with its rather brief and incomplete description of how
  1514. > to write a WDEF. What I need to know is:
  1515.  
  1516. Well, first off, I'm wondering why you chose to write such a WDEF. I have
  1517. made and released a WDEF called the Infinity Windoid WDEF that implements
  1518. such a window look (if you're looking for a System 7-style floating
  1519. window). You can use it for free, and the source is included if you want to
  1520. modify any of its behavior.
  1521.  
  1522. > 1) How to calculate the strucRgn and contRgn regions. IM:TE says to do
  1523. >    this 'based on the current graphics port' but somehow I think that's
  1524. >    wrong.
  1525.  
  1526. I do the following:
  1527.  
  1528. void
  1529. GetGlobalMappingPoint(WindowPeek window, Point *thePoint) {
  1530.     //    This routine returns a point that gives the horizontal and vertical
  1531.     //  offsets needed to map something into global coordinates.
  1532.     GrafPtr savePort;
  1533.     
  1534.     GetPort(&savePort);
  1535.     SetPort((GrafPtr) window);
  1536.     
  1537.     SetPt(thePoint, 0, 0);
  1538.     LocalToGlobal(thePoint);
  1539.     
  1540.     SetPort(savePort);
  1541. }
  1542.  
  1543. void 
  1544. GetGlobalContentRect(WindowPeek window, Rect *contentRect) {
  1545.     Point mappingPoint;
  1546.  
  1547.     *contentRect = window->port.portRect;
  1548.     GetGlobalMappingPoint(window, &mappingPoint);
  1549.     OffsetRect(contentRect, mappingPoint.h, mappingPoint.v);
  1550. }
  1551.  
  1552. void 
  1553. DoWCalcRgns(WindowPeek window, long param) {
  1554.     #pragma unused(param)
  1555.     Rect theRect;
  1556.     RgnHandle tempRgn = NewRgn();
  1557.  
  1558.     // -- calculate the content Rect in global coordinates
  1559.     GetGlobalContentRect(window, &theRect);
  1560.     RectRgn(window->contRgn, &theRect);
  1561.  
  1562.     // -- start off with the structure equal to the content
  1563.     //    & make it include the window frame and titlebar
  1564.     InsetRect(&theRect, -1, -1);
  1565.     if (WindData.hasTitlebar) {
  1566.         if (WindData.isHoriz)
  1567.             theRect.top -= kTitleHeight - 1;
  1568.         else
  1569.             theRect.left -= kTitleHeight - 1;
  1570.     }
  1571.     RectRgn(window->strucRgn, &theRect);
  1572.     
  1573.     // -- add the shadow to the structure 
  1574.     OffsetRect(&theRect, 1, 1);
  1575.     RectRgn(tempRgn, &theRect);
  1576.     UnionRgn(tempRgn, window->strucRgn, window->strucRgn);
  1577.     
  1578.     DisposeRgn(tempRgn);
  1579. }
  1580.  
  1581.  
  1582. > 2) How to retrieve standard window colors from the default color table
  1583. >    easily. I want my palette to reflect the settings in the Color control
  1584. >    panel.
  1585.  
  1586. This is a little more involved. My code has a set of routines that let you
  1587. do this in the most compatible way. There are a lot of little things that
  1588. need to be handled. For example, if the device the floater is on is 8-bit
  1589. but isn't using the System Palette, there might not be enough different
  1590. colors available to appropriately do the color tinging. You will see the
  1591. System WDEF punts and uses black-and-white in that case. My routines handle
  1592. this in a way that is fully compatible with the System WDEF (i.e. when it
  1593. reverts to BW, so does mine).
  1594.  
  1595. > 3) Which QD commands can be used when drawing a window's contents? I have
  1596. >    had little success with RGBForeColor() - I usually get totally different
  1597. >    colors to what I requested.
  1598.  
  1599. If you want to draw in color, you have to make sure that you're using the
  1600. Color Window Manager port. By default, when the WDEF is called, the B/W
  1601. Window Manager port is the current port. Of course, you must sync the color
  1602. port up with the B/W one, which can be done using code like the following
  1603. (which was originally from Macintosh Programming Secrets and modified a
  1604. little by me for my WDEF):
  1605.  
  1606. void 
  1607. SyncPorts(void) {
  1608.     GrafPtr bwPort;
  1609.     CGrafPtr colorPort;
  1610.     
  1611.     GetWMgrPort(&bwPort);
  1612.     GetCWMgrPort(&colorPort);
  1613.     SetPort((GrafPtr) colorPort);
  1614.     
  1615.     BlockMove(&bwPort->pnLoc, &colorPort->pnLoc, 10);
  1616.     BlockMove(&bwPort->pnVis, &colorPort->pnVis, 14);
  1617.     PenPat((ConstPatternParam) &bwPort->pnPat);
  1618.     BackPat((ConstPatternParam) &bwPort->bkPat);
  1619. }
  1620.  
  1621. You should, of course, save the port in your main routine before calling
  1622. this, only call it if Color QuickDraw is present (actually, you only need
  1623. to call it for drawing calls), and restore the port before returning to the
  1624. Window Manager.
  1625.  
  1626. > Any ideas? I would really appreciate any ideas or sample code you might
  1627. > have.
  1628.  
  1629. Like I said before, you really don't have to do all this yourself. I have
  1630. already written a WDEF that does it for you. If you want a different look,
  1631. you can simply modify my WDEF.
  1632.  
  1633. The reason I released it to the public was to provide something I thought
  1634. was lacking in a lot of programs (and still is, when I look through a Mac
  1635. magazine and see a lot of them still using the bland B/W WDEF for floating
  1636. windows).
  1637.  
  1638. There are a lot of people using the Infinity Windoid WDEF now, so it has
  1639. been well tested (it's on its third public release). It supports System 6,
  1640. computers without Color QuickDraw, several different compilation options,
  1641. and it's free. What more could you ask for? (Seriously, if it doesn't do
  1642. something you think it should, let me know.)
  1643.  
  1644. You can always get the latest version of the Infinity Windoid WDEF via
  1645. anonymous FTP at the site 'ftp.i-link.com' in the directory '/pub/infsys/'.
  1646.  
  1647. _troy
  1648. //////// //////___Troy Gaul_________________________t-gaul@i-link.com__ //
  1649.   //    //       I-Link, Ltd. ; West Des Moines, Iowa                  //
  1650.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)           //
  1651. //    //////________________________________________________________ //
  1652.  
  1653. +++++++++++++++++++++++++++
  1654.  
  1655. >From kenlong@netcom.com (Ken Long)
  1656. Date: Wed, 23 Feb 1994 18:48:37 GMT
  1657. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1658.  
  1659. I don't know how much research you've put into your floating palette 
  1660. peliminary background before starting it.  you may already have looked at 
  1661. the Infinity Windoid WDEF, and others.  But there's some source code on 
  1662. Apple's ftp for a program called "DTS.Draw" which has a color, picture 
  1663. menu which tears off.  Once torn off, it becomes a floating palette.
  1664.  
  1665. The pictures in the menu/palette are derived from 'cicn' resources.  They 
  1666. use the 'PICT' button proc of switching to the next higher 'PICT' 
  1667. resource ID number when clicked on.
  1668.  
  1669. You can tap a floater WDEF as the port where you implement your CDEF for 
  1670. your picture buttons.  As such, a ready-made WDEF may be all that's needed.
  1671.  
  1672. I've made floating palettes, just to see how.  All I did was use an 
  1673. existing WDEF for a floater (Infinity, if the titleBar will show), then 
  1674. used a CDEF for picture buttons.  I duplicated the appearence and button 
  1675. opperation (did not tie routines to them) of the MS Word button bar, and 
  1676. part of the Color It tool palette (for training purposes).
  1677.  
  1678. In ResEdit, where you select the procID for the window, I used one of the 
  1679. "?" ones (user defined) and just hooked up the Infinity WDEF to it (even 
  1680. though the title bar was under the menu bar).  Then, the hard part (not 
  1681. really hard, but monotonous) was to set up all the buttons and their 
  1682. 'CTRL' resources.  That "two by two" ID sequencing is quite patience 
  1683. taxing!  As well as doing all the 'CTRL's twice.
  1684.  
  1685. Imagine how it would be for a 256 color palette!  Of course, I did not 
  1686. get into a lot of refinement and detail.  Maybe there's a more brief 
  1687. method for such a thing?
  1688.  
  1689. All I'm saying is that if there's no difference, really, in the window, 
  1690. itself, from other WDEFs, then it's the content that would be the main 
  1691. part of the problem.  And in the case of a palette, it's a CDEF you're 
  1692. looking at.  And iff it's buttons, then the CDEF is pretty common, too - 
  1693. it's expanding it to cover all you want it to that's the job.
  1694.  
  1695. I made a double button bar for the author of KwikKnowledge (for 
  1696. MicroPhone II) which had two rows of 64x64 'PICT' buttons.  They appeared 
  1697. in a standard window.  I just used a 'PICT' button CDEF I downloaded from 
  1698. AOL, which had 3 buttons.  I just dumped the second two, which were 
  1699. different, copied the code for the first one, and hit Command-V 13 
  1700. times.  Then I went back and specified some parts of it.  This was in the 
  1701. CDEF resource code, itself.  once that was done, in was a matter of 
  1702. creating and aligning all the 'CTRL' resources, and adding the 'PICT' 
  1703. resources.  28 of them very monotonous.
  1704.  
  1705. A quicker way to do monotonous resource editing is to make one, decompile 
  1706. that one with ResTools, then make the remaining ones in the text editor.  
  1707. Works for the "easy to see" resources, like 'ditl's, 'CTRL's, etc.
  1708.  
  1709. Does any of this help, or did I miss (again)?
  1710.  
  1711. -Ken-
  1712.  
  1713. +++++++++++++++++++++++++++
  1714.  
  1715. >From kenlong@netcom.com (Ken Long)
  1716. Date: Thu, 24 Feb 1994 04:45:57 GMT
  1717. Organization: NETCOM On-line Communication Services (408 241-9760 guest)
  1718.  
  1719. Troy's message was not there when I followed up.  His advice is more 
  1720. sound than mine because he's a professional programmer.  He made the 
  1721. Color It tool palette.  I assume the color palette, and others, as well.  
  1722. Awesomely done!  Very aesthetic.
  1723.  
  1724. I see that I wrote "CTRL" rather than "CNTL".  My cheap Apple Standard 
  1725. keyboard is the worse for wear.  Many keys have only a small black spot 
  1726. where the label was.  But you get the idea - the control resource.
  1727.  
  1728. What's the procID of the buttons in the Color It tool palette?  And on 
  1729. the color palette, how is the selection done there?
  1730.  
  1731. -Ken-
  1732.  
  1733. +++++++++++++++++++++++++++
  1734.  
  1735. >From dowdy@apple.com (Tom Dowdy)
  1736. Date: Wed, 23 Feb 1994 20:45:56 GMT
  1737. Organization: Apple Computer, Inc.
  1738.  
  1739. In article <kenlongCLoxL3.2M7@netcom.com>, kenlong@netcom.com (Ken Long)
  1740. wrote:
  1741. > A quicker way to do monotonous resource editing is to make one, decompile 
  1742. > that one with ResTools, then make the remaining ones in the text editor.  
  1743. > Works for the "easy to see" resources, like 'ditl's, 'CTRL's, etc.
  1744.  
  1745. Better yet, through creative use of calculations and #defines
  1746. you can actually structure layouts such as the one you are talking
  1747. about (2X2 CNTL arrays) using Rez.  
  1748.  
  1749. The real advantage to taking this approach is that when you decide
  1750. to change things like the size ("Oh gosh, wouldn't 3X3 be better?")
  1751. or the margins, a single change of a #define will get you the results.
  1752.  
  1753. GUI based layout apps are really nice for prototyping, but for
  1754. bulk work, you can often get faster results via the old-fashioned
  1755. text stream based way.
  1756.  
  1757. I usually layout the basics with ResEdit, and then DeRez and work
  1758. >From there.  As an added bonus, you can structure your resources
  1759. to allow for building localized versions of your application
  1760. with just a script.
  1761.  
  1762. -- 
  1763.  Tom Dowdy                  Internet: dowdy@apple.COM
  1764.  Apple Computer MS:302-3KS  UUCP: {sun,voder,amdahl,decwrl}!apple!dowdy
  1765.  1 Infinite Loop            AppleLink: DOWDY1
  1766.  Cupertino, CA 95014       
  1767.  "The 'Ooh-Ah' Bird is so called because it lays square eggs."
  1768.  
  1769. +++++++++++++++++++++++++++
  1770.  
  1771. >From t-gaul@i-link.com (Troy Gaul)
  1772. Date: Thu, 24 Feb 1994 11:36:25 -0600
  1773. Organization: I-Link, Ltd.
  1774.  
  1775. In article <kenlongCLpp8M.BG2@netcom.com>, kenlong@netcom.com (Ken Long)
  1776. wrote:
  1777.  
  1778. > What's the procID of the buttons in the Color It tool palette?  
  1779.  
  1780. You're going to hate the answer. :)
  1781.  
  1782. We don't use resources for the buttons in the tool grid at all. We could,
  1783. we just didn't. They're coded directly into the program. The program knows
  1784. the boundry of the tool area in the tool palette, and it knows the size of
  1785. a button, so from there it generates the grid of buttons, then, in a simple
  1786. 'for' loop, it draws each of the buttons that need to be updated.
  1787.  
  1788. This let us change defines in the program to change the size of the
  1789. buttons. Actually, if I had done it all myself, I don't know if this is the
  1790. scheme I wouls have used. When I came into the project, there was already a
  1791. black and white cool palette. I simply changed the drawing routines to
  1792. handle the nice gray-shaded 3-D effect.
  1793.  
  1794. One other reason that we do things programmatically is that the tool
  1795. palette in Color It! can be edited by dragging and dropping tools into
  1796. spots in the palette (still, I think, one of the coolest features of the
  1797. Color It! tool palette, along with the popups for changing tool parameters
  1798. -- which, by the way, use a stub MDEF to call back into the program). It
  1799. would be possible to do an editable tool palette using controls, just more
  1800. work.
  1801.  
  1802. > And on the color palette, how is the selection done there?
  1803.  
  1804. As for the color palette, all I can say is that you haven't seen anything
  1805. yet! ;-)  The color palette in the next version is my design (the one in
  1806. the current version is an older design by Tom Pinkerton/Kim Montz), and I
  1807. (humbly) think that it's much cooler than the current one.  For the record,
  1808. the new one is generated by a drawing routine, into an offscreen GWorld.
  1809. Then it's just drawn onto the screen when needed with CopyBits.  The old
  1810. one is very similar.
  1811.  
  1812. As far as hit testing and current-color hilighting are concerned, these are
  1813. also done programmaticly. You see, the hit testing that needs to be done
  1814. depends on which type of Color Picker is up, and when a Color Wheel (or
  1815. Color Cube) is up, the color is determined by a distance/angle formula in
  1816. HSL (or HSB), and this color is then converted to RGB for use in the rest
  1817. of the program. When a grid of colors is up, the h and v coordinates of the
  1818. hit in the item are turned into a grid index by some simple mod math. The
  1819. indicators on the wheel/square require a bunch of extra work with regions
  1820. to achieve the effect of not flashing as they move.
  1821.  
  1822. _troy
  1823. //////// //////___Troy Gaul_________________________t-gaul@i-link.com__ //
  1824.   //    //       I-Link, Ltd. ; West Des Moines, Iowa                  //
  1825.  //    //  //   "Iungo ergo sum." (I-Link, therefore I am.)           //
  1826. //    //////________________________________________________________ //
  1827.  
  1828. ---------------------------
  1829.  
  1830. >From rba26@cas.org (Brad Andrews)
  1831. Subject: ZcbFree Goes Negative (Error Number 33)
  1832. Date: Mon, 21 Feb 1994 17:17:55 GMT
  1833. Organization: Chemical Abstracts Service
  1834.  
  1835. This has popped up in the application I am working on, and I am trying
  1836. to figure out why.  Does anyone know what kinds of things might
  1837. make this happen?  I have plenty of memory, so that is not the issue.
  1838.  
  1839. I am expanding the heap according to the logic Apple recommends if
  1840. that matters (at the start of the program).
  1841.  
  1842. ---
  1843.  
  1844. Brad Andrews
  1845. rba26@cas.org
  1846. All opinions are strictly mine
  1847.  
  1848.  
  1849. +++++++++++++++++++++++++++
  1850.  
  1851. >From Steve Bryan <sbryan@maroon.tc.umn.edu>
  1852. Date: Wed, 23 Feb 1994 05:15:34 GMT
  1853. Organization: Sexton Software
  1854.  
  1855. In article <1994Feb21.171755.14980@chemabs.uucp> Brad Andrews,
  1856. rba26@cas.org writes:
  1857. >This has popped up in the application I am working on, and I am trying
  1858. >to figure out why.  Does anyone know what kinds of things might
  1859. >make this happen?  I have plenty of memory, so that is not the issue.
  1860.  
  1861. Brad,
  1862.  
  1863. Amount of memory available is probably not an issue. When zcbFree becomes
  1864. negative that means that memory is being randomly (or not so randomly)
  1865. overwritten. Likely suspects might include not checking result codes and
  1866. proceeding with calls that depend on earlier calls having succeeded (eg
  1867. memory allocations). Another favorite is having your compiler doing a
  1868. multiplication with 2 byte integers when you thought it was using 4 byte
  1869. integers. The resulting negative number then plays havoc with the routine
  1870. that was not expecting it. One of my favorites was having a call to a low
  1871. level file system routine that expects ioNamePtr to be set to a sensible
  1872. value (like a Str255 variable set aside in the stack). If nothing was
  1873. done about (ioNamePtr) you will get unfriendly results even if the result
  1874. code looks good. One final suggestion would be if you call DisposHandle
  1875. on a handle that has already be disposed. There is an init called
  1876. something like Double Trouble which helps track down cases like that.
  1877. Steve Bryan                  InterNet: sbryan@maroon.tc.umn.edu
  1878. Sexton Software            CompuServe: 76545,527
  1879. Minneapolis, MN                   Fax: (612) 929-1799
  1880.  
  1881. +++++++++++++++++++++++++++
  1882.  
  1883. >From rollin@newton.apple.com (Keith Rollin)
  1884. Date: Tue, 22 Feb 1994 20:19:25 GMT
  1885. Organization: Apple Computer, Inc.
  1886.  
  1887. In article <1994Feb21.171755.14980@chemabs.uucp>, rba26@cas.org (Brad
  1888. Andrews) wrote:
  1889.  
  1890. > This has popped up in the application I am working on, and I am trying
  1891. > to figure out why.  Does anyone know what kinds of things might
  1892. > make this happen?  I have plenty of memory, so that is not the issue.
  1893. > I am expanding the heap according to the logic Apple recommends if
  1894. > that matters (at the start of the program).
  1895.  
  1896. Macintosh Technote ME #8 saith (in part):
  1897.  
  1898. "The Memory Manager will trigger an “ID=33” system error when, during some
  1899. operation which scans the objects in the heap, it sees that its running
  1900. count of free bytes (zcbFree, an internal value) has become negative (an
  1901. impossible feat in normal operation). This is nearly always caused by
  1902. writing zeros past the end of one of the Memory Manager’s heap blocks
  1903. (overwriting and corrupting the next block’s header, making it appear to be
  1904. a free block).
  1905.  
  1906. "If you get this error, use a debugger (like Macsbug or TMON) when you
  1907. attempt to reproduce the error, to check the consistency of the heap up to
  1908. the point where the error occurs. You may need to do this repeatedly until
  1909. you isolate the operation that is corrupting the heap."
  1910.  
  1911. ----------------------------------------------------------------------------
  1912. Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- Team
  1913. Newton
  1914.  
  1915. +++++++++++++++++++++++++++
  1916.  
  1917. >From mxmora@unix.sri.com (Matt Mora)
  1918. Date: 23 Feb 1994 09:00:41 -0800
  1919. Organization: SRI International, Menlo Park, CA
  1920.  
  1921. In article <rollin-220294121925@rollin-keith.apple.com> rollin@newton.apple.com (Keith Rollin) writes:
  1922.  
  1923. >----------------------------------------------------------------------------
  1924. >Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- TeamNewton
  1925.                                          ^^^^^^^^^^^^^^^^^^^^
  1926. What's this? Time to sell the Taligent Stock? :-)
  1927.  
  1928.  
  1929. Xavier
  1930.  
  1931.  
  1932.  
  1933. -- 
  1934. ___________________________________________________________
  1935. Matthew Xavier Mora                    Matt_Mora@qm.sri.com
  1936. SRI International                       mxmora@unix.sri.com
  1937. 333 Ravenswood Ave                    Menlo Park, CA. 94025
  1938.  
  1939. +++++++++++++++++++++++++++
  1940.  
  1941. >From devon_hubbard@taligent.com (Devon Hubbard)
  1942. Date: Thu, 24 Feb 1994 20:29:05 GMT
  1943. Organization: Taligent, Inc.
  1944.  
  1945. In article <2kg23p$2ch@unix.sri.com>, mxmora@unix.sri.com (Matt Mora)
  1946. wrote:
  1947.  
  1948. > In article <rollin-220294121925@rollin-keith.apple.com> rollin@newton.apple.com (Keith Rollin) writes:
  1949. > >----------------------------------------------------------------------------
  1950. > >Keith Rollin --- Phantom Programmer --- Apple Computer, Inc. --- TeamNewton
  1951. >                                          ^^^^^^^^^^^^^^^^^^^^
  1952. > What's this? Time to sell the Taligent Stock? :-)
  1953. > Xavier
  1954.  
  1955. Why... do you have Taligent stock?  Gee, I'm jealous?
  1956.  
  1957. --------------------------------------------------------------------------
  1958. Devon Hubbard                                                Silicon Pilot
  1959. devon_hubbard@taligent.com                                   Taligent, Inc
  1960.  
  1961. ---------------------------
  1962.  
  1963. >From adelucia@eden.rutgers.edu (Apple-O)
  1964. Subject: any good magazines?
  1965. Date: 21 Feb 94 08:20:18 GMT
  1966. Organization: Rutgers Univ., New Brunswick, N.J.
  1967.  
  1968. Back in the day, Compute and Compute Gazette had some usefu stuff for learning about programming your computer, with listings of small programs, utiities and other good info. 
  1969.  
  1970. Are there any such pubications out for the mac? I've been out of programming for a while and would like to start learning using C and the mac.
  1971.  
  1972. -- 
  1973. Apollo
  1974.  
  1975. +++++++++++++++++++++++++++
  1976.  
  1977. >From watkeyeh@dunx1.ocs.drexel.edu (Edwin H. Watkeys III)
  1978. Date: Mon, 21 Feb 1994 15:52:44 GMT
  1979. Organization: Drexel University
  1980.  
  1981. In article <Feb.21.03.20.18.1994.6997@eden.rutgers.edu> adelucia@eden.rutgers.edu (Apple-O) writes:
  1982. >Back in the day, Compute and Compute Gazette had some usefu stuff
  1983. for learning about programming your computer, with listings of small
  1984. programs, utiities and other good info.
  1985.  
  1986. >Are there any such pubications out for the mac? I've been out of
  1987. programming for a while and would like to start learning using C and the mac.
  1988.  
  1989. Compute was a lot better at teaching you how to type than how to program.
  1990. Some of those things look like they came out of some Obfuscated BASIC
  1991. Programming Contest. In addition, Compute almost always sucked if you
  1992. cared about the Apple II or Macintosh. They had more VIC-20 programs than
  1993. Apple II ones! I hate them. They dedicated most of the damn issue to
  1994. Commodore crap, and they had another magazine (Compute Gazette) dedicated to
  1995. even more Commodore crap. I don't understand it. Talk about bad taste in
  1996. computers! I can hardly contain my indignation even today towards people who
  1997. put in the same league the Commodore 64 and the Apple IIe.
  1998.  
  1999. But to be constructive for a bit, MacTech Magazine (formerly MacTutor) is
  2000. the Mac developers' magazine. Not "the" as in "the best", but as in "the
  2001. only". There's stuff in there aimed at all sorts of experence levels.
  2002. Yeah, but how many hit points do you have? Ugh! Don't get me started on that! 
  2003.  
  2004. However, you might want to buy a few books instead. It's doubtful that it's
  2005. going to take you a month to digest whatever's in Dave Mark's column.
  2006. You'll be spending a lot of time waiting for the new MacTech to come out.
  2007. I find myself reading anything in English inside MacTech. Hmm, did you
  2008. know their person in charge of circulation is Al Estrada? You know, you go
  2009. crazy... Remember the part in The Treasure of the Sierra Madre where
  2010. Bogart starts laughing like a mad man as his head is engulfed in the
  2011. campfire's flames? Like that...
  2012.  
  2013. Macintosh C Programming Primer Volume I, SECOND EDITION, is pretty good.
  2014. Buy it. Macintosh Programming Secrets, SECOND EDITION, ranks right up
  2015. there with The Big Book of Hell in my list of all time favorite
  2016. technical/reference works. Buy it (Macintosh Programming Secrets, that is). 
  2017.  
  2018. And by the way, C is a good choice, because C is the only language you can
  2019. program the Mac in these days unless you're like Peter Lewis, who has
  2020. displayed uncommon courage in his battle to use a non-discipline-free
  2021. programming language, Pascal. I used to hate C and love Pascal. Now I
  2022. resigned to C and forget how all that pointer stuff works in Pascal. Isn't
  2023. life great?
  2024.  
  2025. I was just thinking -- WriteNow is really nice because it's written in
  2026. assembly, but with the Power Macintoshes coming out, they'd be in a better
  2027. position if their code was in C. "Better" is a mild way of putting it.
  2028. RightNow, they're screwed... (get it? hahahahaha!!!)
  2029.  
  2030. Get me the oxygen mask...ahh,
  2031. Ed
  2032. -- 
  2033. Ed Watkeys              watkeyeh@dunx1.ocs.drexel.edu  Drexel University
  2034. Philosopher-Programmer  EdWatkeys@distant.com           Distant Software
  2035.                         - Use finger for my PGP key. -
  2036.  
  2037. +++++++++++++++++++++++++++
  2038.  
  2039. >From jcg8@pyrite.SOM.CWRU.Edu (Jude Giampaolo)
  2040. Date: 21 Feb 1994 16:45:12 GMT
  2041. Organization: WSOM CSG, CWRU, Cleve., OH, 44106, USA
  2042.  
  2043. In article <CLL03w.8I4@Dunx1.OCS.Drexel.Edu> watkeyeh@dunx1.ocs.drexel.edu (Edwin H. Watkeys III) writes:
  2044. >In article <Feb.21.03.20.18.1994.6997@eden.rutgers.edu> adelucia@eden.rutgers.edu (Apple-O) writes:
  2045. >>Back in the day, Compute and Compute Gazette had some usefu stuff
  2046. >for learning about programming your computer, with listings of small
  2047. >programs, utiities and other good info.
  2048. >
  2049. >>Are there any such pubications out for the mac? I've been out of
  2050. >programming for a while and would like to start learning using C and the mac.
  2051. >
  2052. >Compute was a lot better at teaching you how to type than how to program.
  2053. >Some of those things look like they came out of some Obfuscated BASIC
  2054. >Programming Contest. In addition, Compute almost always sucked if you
  2055. >cared about the Apple II or Macintosh. They had more VIC-20 programs than
  2056. >Apple II ones! I hate them. They dedicated most of the damn issue to
  2057. >Commodore crap, and they had another magazine (Compute Gazette) dedicated to
  2058. >even more Commodore crap. I don't understand it. Talk about bad taste in
  2059. >computers! I can hardly contain my indignation even today towards people who
  2060. >put in the same league the Commodore 64 and the Apple IIe.
  2061.  
  2062. Commodores were the greatest machines! I still have mine, wonderful
  2063. little game box. The c64 was a much better (and cheaper) machine out
  2064. of the box than any of the Apple IIs ever were. IMHO of course... :)
  2065.  
  2066.  
  2067.  
  2068. --
  2069. Jude Charles Giampaolo           -  Case Western Reserve University
  2070. Electrical Engineering           -                  Cleveland, Ohio
  2071. and Applied Physics              -  giampaol@snowhite.eeap.cwru.edu
  2072. Project Caffeine Programmer      -                 jcg8@po.cwru.edu      
  2073.  
  2074. +++++++++++++++++++++++++++
  2075.  
  2076. >From peter@ncrpda.curtin.edu.au (Peter N Lewis)
  2077. Date: 22 Feb 1994 11:32:58 +0800
  2078. Organization: NCRPDA, Curtin University
  2079.  
  2080. adelucia@eden.rutgers.edu (Apple-O) writes:
  2081.  
  2082. >Back in the day, Compute and Compute Gazette had some usefu stuff for
  2083. >learning about programming your computer, with listings of small programs,
  2084. >utiities and other good info. 
  2085.  
  2086. Well, I dont know about a magazine, it doesn't have any adds or anything,
  2087. but Develop is a very good programmers mag.  Its fairly technical
  2088. (pleasant change) and informal (ditto), but it also comes with a CD
  2089. that has all the NIM stuff on it, so its very useful to get.  Plus its
  2090. pretty reasonably priced (US$50 for international, so it must be less for
  2091. US people).
  2092.  
  2093. Now if I ever get my first copy, I'll be even happier...
  2094.    Peter.
  2095. -- 
  2096. _______________________________________________________________________
  2097. Peter N Lewis <peter.lewis@info.curtin.edu.au>       Ph: +61 9 368 2055
  2098.  
  2099. +++++++++++++++++++++++++++
  2100.  
  2101. >From sro@athena.mit.edu (Shawn O'Donnell)
  2102. Date: 22 Feb 1994 19:26:03 GMT
  2103. Organization: Massachusetts Institute of Technology
  2104.  
  2105. I'd give a thumbs down to MacTech Magazine--its useful-things-you-might-
  2106. learn-to-price ratio is too high.  In a good month, you'll get a useful
  2107. Dave Mark column and maybe another article that's useful for someone
  2108. trying to use C on the Mac.  At $4.00 subscription price, $5.85
  2109. newsstand price, that's a lot per page of useful stuff.  
  2110.  
  2111. On the other hand, if someone else is paying, or if you need to see the
  2112. ads for all the development tools, then it might make sense.
  2113.  
  2114. Instead, buy any book about programming the Mac with Knaster as an
  2115. author.  Buy one by Dave Mark if you want a more introductory look at C
  2116. programming on the Mac.  Or that one by Sydow: Think THINK C.
  2117.  
  2118. --Shawn
  2119.  
  2120. +++++++++++++++++++++++++++
  2121.  
  2122. >From editorial@xplain.com (Scott T Boyd)
  2123. Date: Thu, 24 Feb 1994 10:15:04 GMT
  2124. Organization: MacTech Magazine
  2125.  
  2126. <sorry if this is a repost, my connection dropped while sending the first
  2127. time>
  2128.  
  2129. In article <SRO.94Feb22142603@carbonara.mit.edu>, sro@athena.mit.edu (Shawn
  2130. O'Donnell) wrote:
  2131. > I'd give a thumbs down to MacTech Magazine--its useful-things-you-might-
  2132. > learn-to-price ratio is too high.  In a good month, you'll get a useful
  2133. > Dave Mark column and maybe another article that's useful for someone
  2134. > trying to use C on the Mac.  At $4.00 subscription price, $5.85
  2135. > newsstand price, that's a lot per page of useful stuff.  
  2136.  
  2137. Well, funny you should mention that.  
  2138.  
  2139. <----Warning, blatant plug for the magazine is about to happen---->
  2140.  
  2141. Dave Mark's columns generate a lot of mail.  Some people wonder why we 
  2142. carry what they consider to be such rudimentary articles.  Lots more 
  2143. praise his work for easing them gently into Macintosh programming without
  2144. being overwhelmed with complexity.
  2145.  
  2146. What can you do? Improve it all, that's what.  We're working on that, 
  2147. and that's why they recently brought me on as Editor.  I'll be working to
  2148. improve the good-stuff-to-price ratio.  
  2149.  
  2150. To give you something of an idea, we're covering PowerPC technical issues,
  2151. including debugging tips and tricks, details of the PEF file structure,
  2152. calling 68K code from PowerPC code, as well as doing reviews of recent
  2153. developments in a wide variety of tools and development environments.
  2154.  
  2155. You can help.  Write me and let me know what you like, don't like,
  2156. and what you'd like to see us cover.  I get a lot of mail already, so I'm
  2157. not going to promise to reply to everything, but I'll make a good faith
  2158. effort to read everything, and reply when I can.  Don't be surprised if
  2159. a change or idea you suggest winds up in the magazine.
  2160.  
  2161. Even better, write an article for us.  A good, meaty, technical article in
  2162. the useful-things-you-might-learn category.  Send me a note with an outline
  2163. of something you'd like to write about, and we can take it from there. Tips
  2164. and tricks of the trade are also quite welcome.
  2165.  
  2166. > On the other hand, if someone else is paying, or if you need to see the
  2167. > ads for all the development tools, then it might make sense.
  2168.  
  2169. Yes, there is a lot of good information in the ads, and we're working to
  2170. bring you even more interesting things.  
  2171.  
  2172. Please feel free to let us know how we're doing.  You, the reader, are
  2173. the audience we're hoping to please.
  2174.  
  2175. Regards,
  2176. scott t boyd
  2177. (the new) Editor, MacTech Magazine
  2178. editorial@xplain.com
  2179.  
  2180. ---------------------------
  2181.  
  2182. End of C.S.M.P. Digest
  2183. **********************
  2184.  
  2185.  
  2186.